#pragma once

#include <string>
#include <vector>

class USBPort;

class USBHub
{
public:
	USBHub(void);
	~USBHub(void);

	int								GetPortCount()			{ return m_hubPortCount; }
	std::wstring					GetDriverKey()			{ return m_hubDriverKey; }
	std::wstring					GetDevicePath()			{ return m_hubDevicePath; }
	std::wstring					GetDeviceDescription()	{ return m_hubDeviceDescription; }
	std::wstring					GetManufacturer()		{ return m_hubManufacturer; }
	std::wstring					GetProduct()			{ return m_hubProduct; }
	std::wstring					GetSerialNumber()		{ return m_hubSerialNumber; }
	std::wstring					GetInstanceID()			{ return m_hubInstanceID; }
	bool							IsBusPowered()			{ return m_hubIsBusPowered; }
	bool							IsRootHub()				{ return m_hubIsRootHub; }

	void	SetPortCount(const int portCount)						{ m_hubPortCount = portCount; }
	void	SetDriverKey(const wchar_t* pDriverKey)					{ m_hubDriverKey = pDriverKey; }
	void	SetDevicePath(const wchar_t* pDevicePath)				{ m_hubDevicePath = pDevicePath; }
	void	SetDeviceDescription(const wchar_t* pDeviceDescription) { m_hubDeviceDescription = pDeviceDescription; }
	void	SetManufacturer(const wchar_t* pManufacturer)			{ m_hubManufacturer = pManufacturer; }
	void	SetProduct(const wchar_t* pProduct)						{ m_hubProduct = pProduct; }
	void	SetSerialNumber(const wchar_t* pSerialNumber)			{ m_hubSerialNumber = pSerialNumber; }
	void	SetInstanceID(const wchar_t* pInstanceID)				{ m_hubInstanceID = pInstanceID; }
	void	SetBusPowered(const bool isBusPowered)					{ m_hubIsBusPowered = isBusPowered; }
	void	SetRootHub(const bool isRootHub)						{ m_hubIsRootHub = isRootHub; }

	const std::vector<USBPort*>*	GetPorts();

private:
	int						m_hubPortCount;
	std::wstring			m_hubDriverKey;
	std::wstring			m_hubDevicePath;
	std::wstring			m_hubDeviceDescription;
	std::wstring			m_hubManufacturer;
	std::wstring			m_hubProduct;
	std::wstring			m_hubSerialNumber;
	std::wstring			m_hubInstanceID;
	bool					m_hubIsBusPowered;
	bool					m_hubIsRootHub;
	std::vector<USBPort*>	m_ports;

	void FreeUSBPorts();
};
